//
//  LBInstantEffectFilter.mm
//  OpenGLGame
//
//  Created by Nguyen Cong Huy on 3/29/13.
//  Copyright (c) 2013 UIT. All rights reserved.
//

#include "LBInstantEffectFilter.h"
#include "LBExclusionColorFilter.h"
#include "LBSoftlightColorFilter.h"
#include "LBSaturationFilter.h"
#include "LBContrastFilter.h"
#include "LBBrightnessFilter.h"
#include "LBOverlayColorFilter.h"
#include "LBUtils.h"

LBInstantEffectFilter::LBInstantEffectFilter(){
    
    softlight1 = new LBSoftlightColorFilter();
    softlight1->setOpactiy(0.1);
    softlight1->setColor(0.929, 0.843, 0.5);
    
    exclusion = new LBExclusionColorFilter();
    exclusion->setColor(0.0, 0.047, 0.106);
    exclusion->setOpactiy(1.0);
    
    saturation = new LBSaturationFilter();
    saturation->setSaturation(0.2);
    
    overlay1 = new LBOverlayColorFilter();
    overlay1->setColor(0.235, 0.118, 0.0);
    overlay1->setOpactiy(0.2);
    
    overlay2 = new LBOverlayColorFilter();
    overlay2->setColor(0.863, 0.667, 0.0);
    overlay2->setOpactiy(0.1);
    
    brightness = new LBBrightnessFilter();
    brightness->setBrightness(0.1);
    
    contrast = new LBContrastFilter();
    contrast->setContrast(1.2);
    
    softlight1->addTarget(exclusion)->addTarget(saturation)->addTarget(overlay1)->addTarget(overlay2)->addTarget(brightness)->addTarget(contrast);
    firstFilter = softlight1;
}

LBInstantEffectFilter::~LBInstantEffectFilter(){
    outputTexture = 0;
    DELETE_SAFELY(softlight1);
    DELETE_SAFELY(exclusion);
    DELETE_SAFELY(saturation);
    DELETE_SAFELY(overlay1);
    DELETE_SAFELY(overlay2);
    DELETE_SAFELY(brightness);
    DELETE_SAFELY(contrast);
}

void LBInstantEffectFilter::setBlendTexture(LBTexture* blendTexture){

}